package dto;

import lombok.Data;

/**
 * @author kxd
 * @date 2019/8/6 16:24
 * description:
 */
@Data
public class Book {
    private String name;
    private int price;
    public Book(String name,int price){
        this.name=name;
        this.price=price;
    }

    @Override
    public boolean equals(final Object obj) {
        if (obj == null) {
            return false;
        }
        final Book book = (Book) obj;
        if (this == book) {
            return true;
        } else {
            return (this.name.equals(book.name) && this.price == book.price);
        }

    }

    @Override
    public int hashCode() {
        int hashno = 7;
        hashno = 13 * hashno + (name == null ? 0 : name.hashCode());
        return hashno;
    }
}
